package model;

import junit.framework.TestCase;
import org.junit.Test;

public class TestCalories extends TestCase{

	@Test
	public void testCaloriesFood() {
		Food oroSaiwa = new Food(4.0, 0.4, 0.5, "1 biscuit");
		int cal = oroSaiwa.getCalories(16);
		/* 
		 * cal = 4*4*16 + 0,4*4*16 + 0,5*9*16
		 * cal = 256 + 26 + 72
		 * cal = 354
		*/
		assertEquals(cal, 354);
	}
	
	@Test
	public void testCaloriesTraining() {
		Training nuotata = new Training("Swim, 1h", 600, new int[]{102,16});
		int spent = nuotata.getCaloriesSpent();
		assertTrue(spent == 600);
		int integrated = nuotata.getCaloriesIntegrated();
		assertTrue(integrated == 118);
		int cal = nuotata.getCalories();
		assertTrue(cal == -482);
	}

}
